<template>
  <div class="app-container">
    <el-card class="box-card">
      <el-form ref="form" :model="form" >
        <el-descriptions  title="请假申请基本信息"  :column="2" border >
          <el-descriptions-item label="开始时间" :span="1" label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle" >{{ form.leaveStartTime }}</el-descriptions-item>
          <el-descriptions-item label="结束时间" :span="1" label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle" >{{ form.leaveEndTime }}</el-descriptions-item>
          <el-descriptions-item label="事由" :span="2" label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle" >{{ form.causes }}</el-descriptions-item>
        </el-descriptions>
        <br/>
        <el-descriptions  title="部门审核"  :column="2" border >
          <el-descriptions-item label="部门负责人审批结果" :span="1" label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle" ><span v-if="form.departmentHeadResult==1">通过</span><span v-if="form.departmentHeadResult==2">不通过</span></el-descriptions-item>
          <el-descriptions-item label="部门负责人审批时间" :span="1" label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle" >{{ form.departmentHeadTime }}</el-descriptions-item>
          <el-descriptions-item label="部门负责人审批意见" :span="2" label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle" >{{ form.departmentHeadSuggest }}</el-descriptions-item>
        </el-descriptions>
        <br/>
        <el-descriptions  title="局长审核"  :column="2" border >
          <el-descriptions-item label="局长审批结果" :span="1" label-class-name="my-label" :contentStyle='contentStyle':labelStyle="labelStyle" ><span v-if="form.directorGeneralResult==1">通过</span><span v-if="form.directorGeneralResult==2">不通过</span></el-descriptions-item>
          <el-descriptions-item label="局长审批时间" :span="1" label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle" >{{ form.directorGeneralTime }}</el-descriptions-item>
          <el-descriptions-item label="局长审批意见" :span="2" label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle" >{{ form.directorGeneralSuggest }}</el-descriptions-item>
        </el-descriptions>
        <br/>
        <el-descriptions  title="政委审核"  :column="2" border >
          <el-descriptions-item label="政委审批结果" :span="1" label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle" ><span v-if="form.politicalCommissarResult==1">通过</span><span v-if="form.politicalCommissarResult==2">不通过</span></el-descriptions-item>
          <el-descriptions-item label="政委审批时间" :span="1" label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle" >{{ form.politicalCommissarTime }}</el-descriptions-item>
          <el-descriptions-item label="政委审批意见" :span="2" label-class-name="my-label" :contentStyle='contentStyle' :labelStyle="labelStyle" >{{ form.politicalCommissarSuggest }}</el-descriptions-item>
        </el-descriptions>
      </el-form>
      <br/>
      <div style="float:right; margin-bottom: 15px;">
        <el-button @click="viewCancel">返 回</el-button>
      </div>
    </el-card>
  </div>
</template>

<script>
import { listLeave, getLeave, delLeave, addLeave, updateLeave, viewLeave,chiefLeave, gaottLeave, getPhone, getDirector, getCommissor,backLeave} from "@/api/module/cjl/leave";
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import watermark from "watermark-dom";
// 导入省市区数据组件
import { provinceAndCityData,CodeToText, TextToCode } from 'element-china-area-data'
export default {
  name: "Leave",
  components: { Treeselect },
  dicts: ['yh_leave_situation'],
  data() {
    return {
      contentStyle: {
        'width': '500px',
      },
      labelStyle: { 'width': '14%','color': '#000000','text-align': 'right', },
      //城市选项
      options: provinceAndCityData,
      selectedOptions: [],
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: false,
      // 总条数
      total: 0,
      // 休假记录表格数据
      leaveList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        department: null,
        username: null,
        idNumber: null,
        deptid: null,
        causes: null,
        leaveStartTime: null,
        leaveEndTime: null,
        leaveSituation: null,
        leaveAddress: null,
        userId: null,
        deptId: null,
        departmentHeadName: null,
        departmentHeadIdnum: null,
        departmentHeadResult: null,
        departmentHeadTime: null,
        departmentHeadSuggest: null,
        departmentHeadIsacting: null,
        departmentHeadCharacter: null,
        directorGeneralName: null,
        directorGeneralIdnum: null,
        directorGeneralResult: null,
        directorGeneralTime: null,
        directorGeneralSuggest: null,
        directorGeneralIsacting: null,
        directorGeneralCharacter: null,
        politicalCommissarName: null,
        politicalCommissarIdnum: null,
        politicalCommissarResult: null,
        politicalCommissarTime: null,
        politicalCommissarSuggest: null,
        politicalCommissarIsacting: null,
        politicalCommissarCharacter: null,
        leaveTotalState: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      },
      // 表单参数
      form: {
      },
    };
  },
  mounted() {
    watermark.load({ watermark_txt: "  "   });
  },
  created() {
    const id = this.$route.query.id;
    if (id) {
      // 获取表详细信息
      getLeave(id).then(res => {
        this.form = res.data;
      });
    }
  },
  methods: {
    /** 关闭按钮 */
    viewCancel() {
      const id = this.$route.query.id;
      getLeave(id).then(response => {
        this.form = response.data;

      });
      const obj = { path: "/zonghe/yygleave", query: {id} };
      this.$tab.closeOpenPage(obj);
    },
  }
};
</script>
<style lang="scss" scoped>



</style>
